package com.scar1et.simple.factory.operation;

/**
 * 除法
 * Created by scar1et on 15-10-24.
 */
public class Division extends Operation {

    public double getResult() throws Exception {

        if (getNumB() == 0) {
            throw new Exception("除数不能为0");
        } else {
            return (getNumA() / getNumB());
        }

    }
}
